package com.sm.honkon.ui.fragment

import android.os.Bundle
import com.sm.honkon.R
import com.sm.honkon.app.base.BaseFragment
import com.sm.honkon.app.ext.goMain
import com.sm.honkon.databinding.FrgResetAdminBinding
import com.sm.honkon.ui.model.ResetAdminViewModel
import kotlinx.android.synthetic.main.frg_login.*
import me.hgj.jetpackmvvm.ext.nav
import me.hgj.jetpackmvvm.util.get

class ResetAdminFragment:BaseFragment<ResetAdminViewModel,FrgResetAdminBinding>() {
    override fun layoutId(): Int = R.layout.frg_reset_admin
    val isFromLogin = arguments?.get("isFromLogin", true) ?: true

    override fun initView(savedInstanceState: Bundle?) {
        mDatabind.model = mViewModel
        tv_login.setOnClickListener {
            if (isFromLogin)
                mViewModel.login {
                    nav().goMain()
                }
            else
                nav().navigateUp()
        }
    }
}